home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISocketTransport.idl < prev    next >
Text File  |  2006-05-08  |  6KB  |  145 lines

  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #include "nsITransport.idl"
  39.  
  40. interface nsIInterfaceRequestor;
  41. interface nsISocketEventSink;
  42.  
  43. native PRNetAddr(union PRNetAddr);
  44.  
  45. /**
  46.  * nsISocketTransport
  47.  *
  48.  * NOTE: This is a free-threaded interface, meaning that the methods on
  49.  * this interface may be called from any thread.
  50.  */
  51. [scriptable, uuid(66418cc8-5f5d-4f52-a7f9-db8fb3b2cfe6)]
  52. interface nsISocketTransport : nsITransport 
  53. {
  54.     /**
  55.      * Get the host for the underlying socket connection.
  56.      */
  57.     readonly attribute AUTF8String host;
  58.  
  59.     /**
  60.      * Get the port for the underlying socket connection.
  61.      */
  62.     readonly attribute long port;
  63.  
  64.     /** 
  65.      * Returns the IP address of the socket connection peer. This
  66.      * attribute is defined only once a connection has been established.
  67.      */
  68.     [noscript] PRNetAddr getPeerAddr();
  69.  
  70.     /** 
  71.      * Returns the IP address of the initiating end. This attribute
  72.      * is defined only once a connection has been established.
  73.      */
  74.     [noscript] PRNetAddr getSelfAddr();
  75.  
  76.     /**
  77.      * Security info object returned from the secure socket provider.  This
  78.      * object supports nsISSLSocketControl, nsITransportSecurityInfo, and
  79.      * possibly other interfaces.
  80.      */
  81.     readonly attribute nsISupports securityInfo;
  82.     
  83.     /**
  84.      * Security notification callbacks passed to the secure socket provider
  85.      * via nsISSLSocketControl at socket creation time.
  86.      *
  87.      * NOTE: this attribute cannot be changed once a stream has been opened.
  88.      */
  89.     attribute nsIInterfaceRequestor securityCallbacks;
  90.    
  91.     /**
  92.      * Test if this socket transport is (still) connected.
  93.      */
  94.     boolean isAlive();
  95.  
  96.     /**
  97.      * Socket timeouts in seconds.  To specify no timeout, pass PR_UINT32_MAX
  98.      * as aValue to setTimeout.  The implementation may truncate timeout values
  99.      * to a smaller range of values (e.g., 0 to 0xFFFF).
  100.      */
  101.     unsigned long getTimeout(in unsigned long aType);
  102.     void          setTimeout(in unsigned long aType, in unsigned long aValue);
  103.  
  104.     /**
  105.      * Values for the aType parameter passed to get/setTimeout.
  106.      */
  107.     const unsigned long TIMEOUT_CONNECT    = 0;
  108.     const unsigned long TIMEOUT_READ_WRITE = 1;
  109.  
  110.     /**
  111.      * nsITransportEventSink status codes.
  112.      *
  113.      * Although these look like XPCOM error codes and are passed in an nsresult
  114.      * variable, they are *not* error codes.  Note that while they *do* overlap
  115.      * with existing error codes in Necko, these status codes are confined
  116.      * within a very limited context where no error codes may appear, so there
  117.      * is no ambiguity.
  118.      *
  119.      * The values of these status codes must never change.
  120.      *
  121.      * The status codes appear in near-chronological order (not in numeric
  122.      * order).  STATUS_RESOLVING may be skipped if the host does not need to be
  123.      * resolved.  STATUS_WAITING_FOR is an optional status code, which the impl
  124.      * of this interface may choose not to generate.
  125.      */
  126.     const unsigned long STATUS_RESOLVING      = 0x804b0003;
  127.     const unsigned long STATUS_CONNECTING_TO  = 0x804b0007;
  128.     const unsigned long STATUS_CONNECTED_TO   = 0x804b0004;
  129.     const unsigned long STATUS_SENDING_TO     = 0x804b0005;
  130.     const unsigned long STATUS_WAITING_FOR    = 0x804b000a;
  131.     const unsigned long STATUS_RECEIVING_FROM = 0x804b0006;
  132. };
  133.  
  134. %{C++
  135. /**
  136.  * #define's for compatibility
  137.  */
  138. #define NS_NET_STATUS_RESOLVING_HOST nsISocketTransport::STATUS_RESOLVING
  139. #define NS_NET_STATUS_CONNECTED_TO   nsISocketTransport::STATUS_CONNECTED_TO
  140. #define NS_NET_STATUS_SENDING_TO     nsISocketTransport::STATUS_SENDING_TO
  141. #define NS_NET_STATUS_RECEIVING_FROM nsISocketTransport::STATUS_RECEIVING_FROM
  142. #define NS_NET_STATUS_CONNECTING_TO  nsISocketTransport::STATUS_CONNECTING_TO
  143. #define NS_NET_STATUS_WAITING_FOR    nsISocketTransport::STATUS_WAITING_FOR
  144. %}
  145.